package com.qf.bargainexception;

import com.qf.vo.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class PoorExceptionHandler {

    @ExceptionHandler(PoorException.class)
    public ResultVO poor(PoorException ex){
        return new ResultVO(ex.getCode(),ex.getMessage(),null);

    }
    @ExceptionHandler(NumberFormatException.class)
    public ResultVO number(NumberFormatException ex){
        return new ResultVO(100,ex.getMessage(),null);

    }

}
